package com.studytable;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class control
 */
public class control extends HttpServlet {
	private static final long serialVersionUID = 1L;

	/**
     * @see HttpServlet#HttpServlet()
     */
    public control() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		

		response.setContentType("text/html");
		PrintWriter out = response.getWriter();
		String submit = request.getParameter("submit");
		System.out.println("Button Value===========>");
		
		if (submit.equalsIgnoreCase("save")) {
			System.out.println("Method Called!!");
			String name;
			String years;
			String email;
			String bod;
			String address;
			String gender;
			
			name = request.getParameter("name");
			email = request.getParameter("email");
			bod = request.getParameter("bod");
		    address = request.getParameter("address");
			years =request.getParameter("age");
			gender =request.getParameter("gender");
			
			out.println("mine name"+name);
			out.println("<table border='2'>");
			out.println("<tr>");
			out.println("<td>name</td>"+"<td>age</td>"+"<td>email</td>"+"<td>bod</td>"+"<td>gender</td>");
		    out.println("</tr>");
		    out.println("<tr>");
		     out.println("</tr>");
		   
		
		    out.println("<td>"+name+"</td>"+"<td>"+years+"</td>"+"<td>"+email+"</td>"+"<td>"+bod+"</td>"+"<td>"+gender+"</td>");
		    
		    out.println("</table>");
	}
			
}
	

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
